import {observable,action} from 'mobx';
import * as taskMain from '../../apis/task/taskMain'
import { WeaTableNew } from 'comsMobx';
const { TableStore } = WeaTableNew;
export default class TaskTagStore {
    @observable tagTableStore = new TableStore(); // new table
    @observable searchname = '';
    constructor() {

    }
    @action("得到标签列表")
    getTaskTagList = (params) => {
        taskMain.taskTag({operate:'search',searchname:this.searchname}).then(action(res => {
            if (res.status==1) {
                this.tagTableStore.getDatas(res.datas)
            }
        }));
    }
    @action("保存")
    operateTaskTag = (params) => {
        taskMain.taskTag(params).then(action(res => {
            if (res.status==1) {
                this.getTaskTagList();
            }
            if(params.doback){
                params.doback(res.status);
            }
        }));
    }
}